package m2.service;

import java.util.ArrayList;

import m2.port.Port;

public class Service{

        String nameService;
        ArrayList<Port> listePort = new ArrayList<Port>();
               
        /**
         * 
         * @return
         */
        public ArrayList<Port> getListePort() {
                return listePort;
        }

        /**
         * 
         * @param ports
         */
        public void usedPort(Port ... ports) {
                for (Port port : ports){
                	listePort.add(port);
                }
        }      

        /**
         * 
         * @return
         */
        public String getNameService() {
                return nameService;
        }

        /**
         * 
         * @param nameService
         */
        public void setNameService(String nameService) {
                this.nameService = nameService;
        }
        
        /**
         * 
         * @param message
         */
        public void activate(String message){
        	for (Port port : listePort){
        		port.activatePort(message);
        	}
        }
       
}
